#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QWidget>
#include <QTimer>
#include <QDateTime>

#include "loginwidget.h"
#include "resigerwidget.h"
#include "adminwidget.h"
#include "managewidget.h"
#include "changewidget.h"
#include "centerwidget.h"
#include "corediswidget.h"

namespace Ui {
class MainWidget;
}

/**
 * @brief 主界面窗口类
 * 
 * 负责管理程序主界面布局，包含导航栏、地图展示、用户登录等功能模块
 */
class MainWidget : public QWidget
{
    Q_OBJECT

public:
    /**
     * @brief 构造函数
     * @param parent 父窗口指针
     */
    explicit MainWidget(QWidget *parent = nullptr);
    ~MainWidget();

protected:
    virtual void resizeEvent(QResizeEvent *event);

public slots:
    void setWidget(QString);


private:
    /// 界面指针
    Ui::MainWidget *ui;

    /// 当前用户权限等级
    int userLevel = 0;

    /// 数据库连接状态标志
    bool dbConnected = false;

    LoginWidget       *m_LoginWidget;
    ResigerWidget     *m_ResigerWidget;

    AdminWidget       *m_AdminWidget;
    ChangeWidget      *m_ChangeWidget;
    ManageWidget      *m_ManageWidget;

    CenterWidget      *m_CenterWidget;
    CoreDisWidget      *m_CoreDisWidget;

public:
    static QString currentUser;
};

#endif // MAINWIDGET_H
